﻿Imports DAO
Imports DTO
Public Class MonHocBUS

    ''' <summary>
    ''' Lấy danh sách tên các môn học có trong CSDL
    ''' </summary>
    Public Function DSTenMonHoc() As List(Of String)
        Dim ds As List(Of String)
        Dim dao As New MonHocDAO
        ds = dao.DSTenMonHoc
        Return ds
    End Function

    ''' <summary>
    ''' Lấy danh sách môn học
    ''' </summary>
    ''' <returns>Bảng các thông tin liên quan</returns>
    ''' <remarks></remarks>
    Public Function LayDSMonHoc() As DataTable
        Dim dt As New DataTable
        Dim MonHocDAO As New MonHocDAO
        dt = MonHocDAO.LayDSMonHoc()
        Return dt
    End Function

    ''' <summary>
    ''' Lấy mã môn học
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function LayMaMonHoc(ByVal dto As MonHocDTO) As String
        Dim DAO As New MonHocDAO
        Return DAO.LayMaMonHoc(dto)
    End Function
    ''' <summary>
    ''' Lấy danh sách giáo viên phụ trách
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function DSGVPhuTrach(ByVal dto As MonHocDTO) As DataTable
        Dim dt As New DataTable
        Dim dao As New MonHocDAO
        dt = dao.DSGVPhuTrach(dto)
        Return dt
    End Function
    ''' <summary>
    ''' Cập nhật môn học
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <remarks></remarks>
    Public Sub CapNhat(ByVal dto As MonHocDTO)
        Dim DAO As New MonHocDAO
        DAO.CapNhatMonHoc(dto)
    End Sub
    ''' <summary>
    ''' Thêm môn học
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <remarks></remarks>
    Public Sub Them(ByVal dto As MonHocDTO)
        Dim dao As New MonHocDAO
        dao.Them(dto)
    End Sub
    Public Function LayMa() As String
        Dim dao As New MonHocDAO
        Return dao.MaMonHoc()
    End Function

    Public Sub Xoa(ByVal dto As MonHocDTO)
        Dim DAO As New MonHocDAO
        DAO.Xoa(dto)
    End Sub
End Class
